<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ page import="sfmc.biz.vo.Sfmc_TB_STATUS"%>
<%
String yearlyStatusList  = (String)request.getAttribute("yearlyStatusList");
Sfmc_TB_STATUS yearlystatusdata = (Sfmc_TB_STATUS)request.getAttribute("yearlystatusdata");
%>

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=IE8" />
<meta http-equiv="Cache-Control" content="No-Cache" />
<meta http-equiv="Pragma" content="No-Cache" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>년별 통계</title>
<link rel="stylesheet" type="text/css" href="/resources/theme/metro-blue/easyui.css" />
<link rel="stylesheet" type="text/css" href="/resources/theme/icon.css" />
<link rel="stylesheet" type="text/css" href="/resources/css/ui_custom.css" />
<link rel="stylesheet" type="text/css" href="/resources/css/design.css" />
<link rel="stylesheet" type="text/css" href="/resources/css/form.css" />
<!--[if lt IE 9]>
	<script type="text/javascript" src="/resources/js/html5.js" /></script>
<![endif]-->
<script type="text/javascript" src="/resources/js/jquery-1.9.1.js"></script>
<script type="text/javascript" src="/resources/js/jquery.easyui.min.js"></script>
<script type="text/javascript" src="/resources/js/jquery.jclock.js"></script>
<script type="text/javascript" src="/resources/js/common.js" /></script>
<script type="text/javascript" src="/resources/js/is.validate.js" /></script>

<script type="text/javascript" language="javascript">


//easy ui calendar 날짜 포맷 변경
function myformatter(date){
    var y = date.getFullYear();
    var m = date.getMonth()+1;
    var d = date.getDate();
    return y;
}
function myparser(s){
    if (!s) return new Date();
    var ss = (s.split('-'));
    var y = parseInt(ss[0],10);
    var m = parseInt(ss[1],10);
    var d = parseInt(ss[2],10);
    if (!isNaN(y) && !isNaN(m) && !isNaN(d)){
        return new Date(y,m-1,d);;
    } else {
        return new Date();
    }
}
//칼렌더의 키이벤트 

function getListEnter(){
	if(event.keyCode != 13){
		return false;
	}else{
		getList();
	}
}
function getList(){
	
	document.form.target = "_self";
	document.form.action="/yearlyStauts_list.do";
	document.form.submit();
	
}
function getExcel(){
	document.form.target = "_self";
	document.form.action="/yearlyStauts_excel.do";
	document.form.submit();
}

</script>
</head>
	
<body class="pop easyui-layout">
<form method="POST" name="form">
<iframe id="behindFrame" name="behindFrame"></iframe>
<input type="hidden" name="" value=""/>
<input type="hidden" name="" value="0"/>
	<div data-options="region:'center',border:false,iconCls:'icon-head02',title:'년별 통계'">	
	
		<div class="easyui-layout" data-options="fit:true">
			<div data-options="region:'center',border:false">
				<div class="easyui-panel bb0" data-options="border:false,fit:true">
					<table id="grid_yearlystatus" class="easyui-datagrid"></table>
							
					<div id="tb_yearlystatus" class="datagrid-toolbar wrap_tbl_toolbar">	
						<table class="tbl_inner">	
							<colgroup>
								<col width="50px">
								<col width="90px">
								<col width="50px">
								<col width="90px">
								<col width="60px">
								<col width="80px">
								<col width="80px">
								<col width="80px">
							</colgroup>
							<tr>
								<th>시작일</th>
								<td class="formText"><input class="easyui-datebox" data-options="formatter:myformatter" name="searchFromDate" value="<%=yearlystatusdata.getSearchFromDate() %>" onKeyPress="getListEnter();" onKeyDown=""/></td>
								<th>종료일</th>
								<td class="formText"><input class="easyui-datebox" data-options="formatter:myformatter" name="searchToDate" value="<%=yearlystatusdata.getSearchToDate() %>" onKeyPress="getListEnter();" onKeyDown=""/></td>
								<th>업체명</th>
								<td class="formText"><input type="text" name="searchCustName" value="<%=yearlystatusdata.getCustName() %>" onKeyPress="getListEnter();"/></td>
								<th>고객전화번호</th>
								<td class="formText"><input type="text" name="searchCustPhone" value="<%=yearlystatusdata.getSearchCustPhone() %>" onKeyPress="getListEnter();"/></td>
								<td><a href="javascript:getList();"class="easyui-linkbutton" data-options="iconCls:'icon-search'">조회</a>
								<a href="javascript:getExcel();" class="easyui-linkbutton" data-options="iconCls:'icon-excel'">엑셀저장</a>
							</tr>
						</table>
					</div>
				</div>
			</div>
		</div>
	</div>

	<div data-options="region:'south',border:false" class="layout_south alignL">
		Copyright 2013 Suwon City Facilities Management Corporation. All rights reserved.
		<p class="btn_close" title="닫기" onclick="window.close()"></p>
	</div>
		
</form>
<script type="text/javascript">
//그리드
$('#grid_yearlystatus').datagrid({
	rownumbers:true,
    fitColumns: true,
    singleSelect: true,
    fit: true,
    striped: true,
    toolbar:'#tb_yearlystatus',
    //pagination: true,
    nowrap: true,
    data:<%=yearlyStatusList%>,
    columns:[[
        {field:'ordDate',title:'주문년도',fixed:true,width:120,align:'center'},
        {field:'statusCount',title:'주문건수',fixed:true,width:120,align:'center'}
    ]]
});
function viewTitle(val,rec){
	return '<span title="'+val+'">'+val+'</span>';
}
</script>
</body>

</html>